package cn.zysuyuan.item.service.impl;

import cn.zysuyuan.common.entity.PageResult;
import cn.zysuyuan.item.entity.MedicinalInf;
import cn.zysuyuan.item.mapper.MedicinalInfMapper;
import cn.zysuyuan.item.service.MedicinalInfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;
import java.util.Map;

/**
 * @author flypig
 * @version 1.0
 * @date 2019/10/28 16:12
 */

@Service
public class MedicinalInfServiceImpl implements MedicinalInfService {

    @Autowired
    private MedicinalInfMapper medicinalInfMapper;

    /**
     * 查询所有中药材信息，用于药材浏览
     * @return
     */
    @Override
    public PageResult<MedicinalInf> selectList(Map<String, Object> map) {

        // 存入list中
        List<MedicinalInf> medicinalInfs = this.medicinalInfMapper.selectList(map);
        return new PageResult<MedicinalInf>(medicinalInfs);
    }

    @Override
    public PageResult<MedicinalInf> medicinalDetails(Map<String, Object> map) {

        List<MedicinalInf> medicinalDetails = this.medicinalInfMapper.medicinalDetails(map);
        return new PageResult<MedicinalInf>(medicinalDetails);
    }

}
